package model;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class TForumConent {
	private int contentid;
	private int forumid;
	private int ordernum;
	private int photocontent;
	private String textcontent;
	private int isrecommand;
	
	
	public TForumConent() {
		super();
	}
	
	public TForumConent(ResultSet rs){
		try {
			this.contentid = rs.getInt("contentid");
			this.forumid = rs.getInt("forumid");
			this.ordernum = rs.getInt("ordernum");
			this.photocontent = rs.getInt("photocontent");		
			this.textcontent = rs.getString("textcontent");
			this.isrecommand = rs.getInt("isrecommand");
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	public static List<TForumConent> toList(ResultSet rs){
		List<TForumConent> list = new ArrayList<TForumConent>();
		if(rs!=null)
		{
			try {
				while (rs.next()) {
					TForumConent user = new TForumConent();
					user.contentid = rs.getInt("contentid");
					user.forumid = rs.getInt("forumid");
					user.ordernum = rs.getInt("ordernum");
					user.photocontent = rs.getInt("photocontent");
					user.textcontent = rs.getString("textcontent");
					user.isrecommand = rs.getInt("isrecommand");
					list.add(user);
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return list;
		
	}


	public TForumConent(int contentid, int forumid, int ordernum,
			int photocontent, String textcontent, int isrecommand) {
		super();
		this.contentid = contentid;
		this.forumid = forumid;
		this.ordernum = ordernum;
		this.photocontent = photocontent;
		this.textcontent = textcontent;
		this.isrecommand = isrecommand;
	}


	public int getContentid() {
		return contentid;
	}


	public void setContentid(int contentid) {
		this.contentid = contentid;
	}







	public int getForumid() {
		return forumid;
	}

	public void setForumid(int forumid) {
		this.forumid = forumid;
	}

	public int getOrdernum() {
		return ordernum;
	}


	public void setOrdernum(int ordernum) {
		this.ordernum = ordernum;
	}


	public int getPhotocontent() {
		return photocontent;
	}


	public void setPhotocontent(int photocontent) {
		this.photocontent = photocontent;
	}


	public String getTextcontent() {
		return textcontent;
	}


	public void setTextcontent(String textcontent) {
		this.textcontent = textcontent;
	}


	public int getIsrecommand() {
		return isrecommand;
	}


	public void setIsrecommand(int isrecommand) {
		this.isrecommand = isrecommand;
	}



	
	
}
